var UnitDetailMixin = {
    data: function() {
        return {
            unit: {
                type: Object,
                default: function() {
                    return {}
                }
            },
            eventChannel: null
        }
    },
    onReady() {
        this.eventChannel = this.getOpenerEventChannel();
        this.eventChannel.on("openPage", (info) => {
            this.unit = info.unit;
            uni.setNavigationBarTitle({
                title: info.type.name
            })
        })
    },
    methods: {
        tapItem(e) {
            let word = e.item;
            if (e.item.tag.indexOf("point") != -1) {
                console.log("point", word.data);
            }
        }
    }
}

export default UnitDetailMixin;